<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>精灵图案例之拼出自己的名字</title>
    <style>
        span {
            display: inline-block;
            background: url(./images/abcd.jpg) no-repeat;
        }

        /* 简化后的代码，利用css的层叠性 */

        .c {
            width: 102px;
            height: 118px;
            background-position: -239px 0;
        }

        .u {
            width: 108px;
            height: 108px;
            background-position: -478px -421px;

        }

        .r1 {
            width: 111px;
            height: 108px;
            background-position: -136px -416px;
        }

        .r2 {
            width: 111px;
            height: 108px;
            background-position: -136px -416px;
        }

        .y {
            width: 109px;
            height: 108px;
            background-position: -368px -557px;
        }
    </style>
</head>

<body>
    <span class="c"></span>
    <span class="u"></span>
    <span class="r1"></span>
    <span class="r2"></span>
    <span class="y"></span>
</body>

</html>